/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.srcptit.trainning.thompv.btvn1;
import java.util.Scanner;
/**
 *
 * @author SONY
 */
public class Bai1Muc2
{
    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);
        int n;
        n=sc.nextInt();
        int []a=new int[1000];
        for(int i=1;i<=n;i++)
            a[i]=sc.nextInt();
        for(int i=1;i<n;i++)
            for(int j=i+1;j<=n;j++)
                if(a[i]>a[j])
                {
                    int tmp=a[i];
                    a[i]=a[j];
                    a[j]=tmp;
                }
        System.out.println("ket qua sau khi sap xep:");
        for(int i=1;i<=n;i++)
            System.out.print(a[i]+"   ");
        System.out.println("");  
    }
}
